package com.nbsaas.boot.wms.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.*;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.util.Date;

@ComposeView
@Data
@FormAnnotation(title = "仓库", model = "仓库")
@Entity
@Table(name = "nb_wms_warehouse")
public class Warehouse extends AbstractEntity {


    @Comment("代码")
    @FormField(title = "代码", grid = true)
    @Column(length = 50, unique = true)
    private String code;

    @Comment("名称")
    @SearchItem(name = "name", key = "name", label = "名称")
    @FormField(title = "名称", grid = true)
    @Column(length = 50)
    private String name;

    @FieldName
    @FieldConvert
    @ManyToOne(fetch = FetchType.LAZY)
    private WarehouseCatalog catalog;

    @Comment("地址")
    @FormField(title = "地址", grid = true)
    private String address;

    @Comment("电话")
    @FormField(title = "电话", grid = true)
    @Column(length = 20)
    private String phone;

    @Comment("纬度")
    @FormField(title = "纬度", grid = true)
    private Double lat;

    @Comment("经度")
    @FormField(title = "经度", grid = true)
    private Double lng;

    @Comment("外部编码(对接ERP专用)")
    @SearchItem(name = "externalCodeErp", key = "externalCodeErp", label = "外部编码(对接ERP专用)")
    @FormField(title = "外部编码(对接ERP专用)", grid = true)
    @Column(length = 50)
    private String externalCodeErp;

    @Comment("建档人")
    @FormField(title = "建档人", grid = true)
    @Column(length = 30)
    private String creator;

    @Comment("Adaptor外部编码")
    @FormField(title = "Adaptor外部编码", grid = true)
    @Column(length = 50)
    private String adaptorCode;

    @Comment("WMS货主编号")
    @FormField(title = "WMS货主编号", grid = true)
    @Column(length = 50)
    private String wmsOwnerCode;

    @Comment("仓库属性1")
    @FormField(title = "仓库属性1", grid = true)
    @Column(length = 20)
    private String attr1;


    @Comment("仓库属性2")
    @FormField(title = "仓库属性2", grid = true)
    @Column(length = 20)
    private String attr2;

    @Comment("仓库属性3")
    @FormField(title = "仓库属性3", grid = true)
    @Column(length = 20)
    private String attr3;

    @Comment("仓库属性4")
    @FormField(title = "仓库属性4", grid = true)
    @Column(length = 20)
    private String attr4;

    @Comment("仓库属性5")
    @FormField(title = "仓库属性5", grid = true)
    @Column(length = 20)
    private String attr5;

    @Comment("仓库属性6")
    @FormField(title = "仓库属性6", grid = true)
    @Column(length = 20)
    private String attr6;

    @Comment("最近盘点日")
    @FormField(title = "最近盘点日", grid = true)
    private Date lastInventoryDate;

    @Comment("备注")
    @FormField(title = "备注", grid = true)
    private String remark;

    @Comment("营销区域")
    @FormField(title = "营销区域", grid = true)
    @Column(length = 50)
    private String marketingArea;

    @Comment("仓库批次管理模式")
    @FormField(title = "仓库批次管理模式", grid = true)
    @Column(length = 50)
    private String batchManagementMode;

    @Comment("区/县")
    @FormField(title = "区/县", grid = true)
    @Column(length = 50)
    private String district;

    @Comment("EMAIL")
    @FormField(title = "EMAIL", grid = true)
    @Column(length = 50)
    private String email;

    @Comment("传真")
    @FormField(title = "传真", grid = true)
    @Column(length = 20)
    private String fax;

    @Comment("停止使用")
    @FormField(title = "停止使用", grid = true)
    private Boolean disabled;

    @Comment("原代码")
    @FormField(title = "原代码", grid = true)
    @Column(length = 50)
    private String originalCode;

    @Comment("建档日期")
    @FormField(title = "建档日期", grid = true)
    private Date createDate;

    @Comment("省")
    @FormField(title = "省", grid = true)
    @Column(length = 50)
    private String province;

    @Comment("市")
    @FormField(title = "市", grid = true)
    @Column(length = 50)
    private String city;

    @Comment("货运周期")
    @FormField(title = "货运周期", grid = true)
    @Column(length = 50)
    private String shippingCycle;


    @Comment("不品检")
    @FormField(title = "不品检", grid = true)
    private Boolean noInspection;


    @Comment("手机")
    @FormField(title = "手机", grid = true)
    @Column(length = 20)
    private String mobile;

    @Comment("配货总部不允许验收")
    @FormField(title = "配货总部不允许验收", grid = true)
    private Boolean noAcceptanceByHeadquarters;

    @Comment("E3外部编码")
    @FormField(title = "E3外部编码", grid = true)
    @Column(length = 50)
    private String e3ExternalCode;

    @Comment("WMS库区编码")
    @FormField(title = "WMS库区编码", grid = true)
    @Column(length = 50)
    private String wmsAreaCode;

    @Comment("不控制负库存")
    @FormField(title = "不控制负库存", grid = true)
    private Boolean noNegativeStockControl;

    @Comment("联系人")
    @FormField(title = "联系人", grid = true)
    @Column(length = 50)
    private String contactPerson;


    @Comment("配货订单总部不许审批")
    @FormField(title = "配货订单总部不许审批", grid = true)
    private Boolean noApprovalByHeadquarters;

    @Comment("业务员")
    @FormField(title = "业务员", grid = true)
    @Column(length = 50)
    private String salesman;

    @Comment("负责人")
    @FormField(title = "负责人", grid = true)
    @Column(length = 50)
    private String manager;

    @Comment("不控制数量不足")
    @FormField(title = "不控制数量不足", grid = true)
    private Boolean noInsufficientStockControl;


    @Comment("修改人")
    @FormField(title = "修改人", grid = true)
    @Column(length = 30)
    private String modifier;

    @Comment("邮编")
    @FormField(title = "邮编", grid = true)
    @Column(length = 10)
    private String zipCode;

    @Comment("发货价格设定")
    @FormField(title = "发货价格设定", grid = true)
    @Column(length = 50)
    private String shippingPriceSetting;

    @Comment("WMS外部编码")
    @FormField(title = "WMS外部编码", grid = true)
    @Column(length = 50)
    private String wmsExternalCode;

    @Comment("修改日期")
    @FormField(title = "修改日期", grid = true)
    private Date modifyDate;

    @Comment("不控制数量溢出")
    @FormField(title = "不控制数量溢出", grid = true)
    private Boolean noOverflowStockControl;

    @Comment("次品仓库")
    @FormField(title = "次品仓库", grid = true)
    private Boolean defectiveWarehouse;

    @Comment("传呼")
    @FormField(title = "传呼", grid = true)
    @Column(length = 20)
    private String pager;

    @Comment("所属渠道")
    @FormField(title = "所属渠道", grid = true)
    @Column(length = 50)
    private String channel;

    @Comment("仓库职能")
    @FormField(title = "仓库职能", grid = true)
    @Column(length = 50)
    private String warehouseFunction;

    @Comment("性质")
    @FormField(title = "性质", grid = true)
    @Column(length = 50)
    private String nature;

    @Comment("发货不判断唯一码状态")
    @FormField(title = "发货不判断唯一码状态", grid = true)
    private Boolean noUniqueCodeCheck;


    @Comment("折扣")
    @FormField(title = "折扣", grid = true)
    private Double discount;

    @Comment("区域")
    @FormField(title = "区域", grid = true)
    @Column(length = 50)
    private String region;


    @Comment("外部编码(对接POS专用)")
    @FormField(title = "外部编码(对接POS专用)", grid = true)
    @Column(length = 50)
    private String externalCodePos;


    @Comment("退货价格设定")
    @FormField(title = "退货价格设定", grid = true)
    @Column(length = 50)
    private String returnPriceSetting;

    @Comment("全部品牌")
    @FormField(title = "全部品牌", grid = true)
    private Boolean allBrands;

    @Comment("类别")
    @FormField(title = "类别", grid = true)
    @Column(length = 50)
    private String category;
}